#include "simple/graphical/color_vector.hpp"
#include "simple/geom/bool_algebra.hpp"
#include "simple/support/int_literals.hpp"
#include <cassert>

using namespace simple::graphical::color_literals;
using namespace simple::support::literals;
using namespace simple::graphical;

void ColorLimitConversion()
{
	using rgb_float = color_vector<float,3>;
	using rgba_float = color_vector<float,4>;
	using rgba = color_vector<std::uint8_t,4>;
	assert( rgb_float(0xab00cd_rgb) == rgb_float(0xab/255.f, 0.f, 0xcd/255.f)  );
	assert( rgba_float(rgb_float(0xab00cd_rgb)) == rgba_float(0xab/255.f, 0.f, 0xcd/255.f, 1.f)  );
	assert( rgba_float(0xab00cd_rgb) == rgba_float(0xab/255.f, 0.f, 0xcd/255.f, 1.f)  );
	assert( rgba(rgb_float(0xab00cd_rgb)) == rgba(0xab_u8, 0_u8, 0xcd_u8, 255_u8)  );
	assert( rgba_float(rgba(rgb_float(0xab00cd_rgb))) == rgba_float(0xab/255.f, 0.f, 0xcd/255.f, 1.f)  );

	struct s
	{
		rgb_float c;
	};
	assert( s{0xab00cd_rgb}.c == rgb_float(0xab/255.f, 0.f, 0xcd/255.f)  ); // this used to silently not work, picking up vector's implicit uint to float conversion
}

int main()
{
	ColorLimitConversion();
	return 0;
}
